package robocup.component.actions;

/**
 * PointToAction is used to let the arm of a player point to a certain position.
 * This is defined as distance and direction. Note, that the noise of seeing
 * this is very large.
 */
public class PointToAction
    extends Action {

  /**
   * The distance to the position, which is pointed at.
   */
  private double _dist;

  /**
   * The direction to the position, which is pointed at.
   */

  private double _dir;

  /**
   * Constructor - am action which causes the agent to point his arm somewhere
   * 
   * @param dist
   *          the distance of the point, to which the agent points to
   * @param dir
   *          the direction of the point, to which the agent points to
   */
  public PointToAction(
      final double dist,
      final double dir) {

    this._dist = dist;
    this._dir = dir;
    this._type = TYPE.POINTTO;
  }

  /**
   * Returns the actions string representation:
   * 
   * @return (pointto &lt;dist&gt; &lt;dir&gt;)<br>
   *         <br>
   */
  @Override
  public String toString() {

    final StringBuffer buf = new StringBuffer();
    buf.append("(pointto ");
    buf.append((int) this._dist);
    buf.append(" ");
    buf.append((int) this._dir);
    buf.append(")");
    return buf.toString();
  }

  /**
   * @return Returns the direction of this action.
   */
  public double getDir() {

    return this._dir;
  }

  /**
   * @return Returns the distance of this action.
   */
  public double getDist() {

    return this._dist;
  }
}
